from datetime import datetime
from datetime import timedelta
datetime.today() #返回当前时间的datetime对象
datetime.now() #同上，可以用时区作参数
datetime.strptime('2018/06/30', '%Y/%m/%d')  # 返回datetime对象
dt = datetime.today()
datetime.ctime(dt)
datetime.strftime(dt, "%Y%m%d")

days = timedelta(days=90,hours=3) #常用
dt2 = dt + days
dt2.year
dt2.month
dt2.day
dt2.hour